<?php

namespace App\Models;

use App\Enums\TransferSource;
use App\Enums\TransferStatus;
use BenSampo\Enum\Traits\CastsEnums;

/**
 * @mixin IdeHelperTransferRecord
 */
class TransferRecord extends BaseModel
{
    use CastsEnums;

    protected $casts = [
        'status' => TransferStatus::class,
        'source' => TransferSource::class,
    ];

    public function asset()
    {
        return $this->belongsTo(Asset::class);
    }

    public function to_user()
    {
        return $this->belongsTo(FrontendUser::class, 'to_user_id');
    }
}
